<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/9/7
  Time: 10:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
    <%

        Cookie[] cookies = request.getCookies();
        if(cookies!=null){
            for(int i=0;i<cookies.length;i++){
                if(cookies[i].getName().equals("uname"))
                    response.sendRedirect("getCokie.jsp");
            }
        }
    %>
<body>
    <form name="loginForm" method="post" action="addCokie.jsp">
        用户名：<input type="text" name="userName" />
        密码：<input type="password" name="pwd" />
        <input type="submit" value="登录">
    </form>
</body>
</html>
